package com.svms.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import com.svms.service.vo.TransportVO;
import com.svms.service.vo.VehicleVO;

public class VehcielData {

	public List<VehicleVO> getAllVehicleInfo() {

		Random randomGenerator = new Random();
		List<VehicleVO> vehicleDataList = new ArrayList<VehicleVO>();
		TransportData data = new TransportData();
		setVehicleDocsDate();

		VehicleVO vehicleVO;
		for (int i = 0; i < 20; i++) {
			int id = (i + 101);
			randomGenerator.nextInt(1000);
			vehicleVO = new VehicleVO();
			vehicleVO.setVehicleId(String.valueOf(id));
			vehicleVO.setModel("W" + randomGenerator.nextInt(1000));
			TransportVO transportVO = data.getAllTransportInfo().get(0);
			vehicleVO.setTransport(transportVO);
			vehicleVO.setVehicleNumber("TN" + randomGenerator.nextInt(1000));
			vehicleVO.setDistanceTraveled(String.valueOf(randomGenerator
					.nextInt(1000)));
			vehicleVO.setVehicleDocuments(setVehicleDocsDate());
			vehicleDataList.add(vehicleVO);
			// System.out.println(vehicleVO);
		}

		return vehicleDataList;
	}

	private Map<String, Date> setVehicleDocsDate() {
		Map<String, Date> docsMap = new HashMap<String, Date>();

		Date localDate = new Date();
		System.out.println(localDate.toString()); // Sat Jan 02 00:00:00 BOT
													// 2010

		docsMap.put("FORM47_TD", localDate);
		docsMap.put("NC_TD", localDate);
		docsMap.put("FC_TD", localDate);
		docsMap.put("INSURANCE_TD", localDate);
		docsMap.put("TAX_TD", localDate);
		return docsMap;
	}

	public void populateTransportData() {

	}
}
